package com.xiaolin.util;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * @ClassName TestScanner
 * @Description TODO
 * @Detail 测试Scanner，可以获取输入流的数据
 * @Author MyPC
 * @Date 2020/9/27
 * @Version 1.0
 */
public class TestScanner {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner scanner=new Scanner(new FileInputStream("D:\\1file\\data.txt"),"GBK");
        while (scanner.hasNext()){
            System.out.println(scanner.nextLine());
        }
    }
}
